package com.huaxin.hxmoduleworkorder.models;

import com.baomidou.mybatisplus.annotation.TableField;
import com.huaxin.hxmoduleworkorder.common.StringListToJsonTypeHandler;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.List;

@Data
public class InspectionOrderStatusCalculationResult {
    @TableField(value = "order_id")
    @Schema(description = "工单ID", example = "o1001")
    private String orderId;

    @TableField(value = "customer_ids", typeHandler = StringListToJsonTypeHandler.class, exist = true)
    @Schema(description = "涉及客户ID列表（JSON数组）", example = "[\"c1001\",\"c1002\"]")
    private List<String> customerIds;

    @TableField(value = "completed_customer_count")
    @Schema(description = "已完成客户数：该客户所有检查项都非 pending", defaultValue = "0")
    private Integer completedCustomerCount;

    @TableField(value = "in_progress_customer_count")
    @Schema(description = "进行中客户数：该客户有检查项处于 pending 状态", defaultValue = "0")
    private Integer inProgressCustomerCount;

    @TableField(value = "calculated_status")
    @Schema(description = "工单状态：pending、completed、in_progress", example = "pending")
    private String calculatedStatus;
}

